<!DOCTYPE html>
<html style="background-color: #F1F4FB">

<head>
    <meta charset="utf-8">
    <title>专利台账页面</title>
    <!--公用样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/comment.css"/>
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/supplier/common/css/style.css"/>
    <!--extended-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/extended.css"/>
    <!--Layui-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
    <!--公用样式JS-->
    <script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
    <script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.js" charset="utf-8"></script>
</head>
<style>
    .Right {
        overflow-y: auto;
        width: 100%;
        left: 16%;
        top: 144px;
    }
    .layui-table-cell {
        text-align: center;
        font-size:14px;
        padding:0 5px;
        height:auto;
        overflow:visible;
        text-overflow:inherit;
        white-space:normal;
        word-break: break-all;
    }
    .layui-laypage-limits select {
        width: 70px;
    }
</style>

<body>
<!--头部-->

<!--容器-->
<div class="layui-container" style="background-color: #ffffff;width:96%;margin-top:60px;padding:16px;border-radius: 10px">
    <!--筛选行-->
    <div class="layui-row">
        <table id="booktable" layui-filter="booktable">

        </table>
    </div>

    <#--	<div class="Right fr mt10">-->
    <#--		<div class="layui-row" style="background-color: #e0e0e0;padding:20px 1%;margin-top:30px;border-radius: 5px">-->
    <#--			<div class="layui-col-md2">-->
    <#--				<span>计划类别:</span>-->

    <#--			</div>-->
    <#--			<div class="layui-col-md2" style="width: 26%">-->
    <#--				<span style="display: inline-block;width:27%">获取时间:</span>-->
    <#--				<input id="hp_time_begin" type="text"  style="display: inline-block;width:35%" value="2021-05-01">-->
    <#--				<span>至</span>-->
    <#--				<input id="hp_time_end" type="text"  style="display: inline-block;width:35%"  value="2021-05-02">-->
    <#--			</div>-->
    <#--		</div>-->
    <#--	</div>-->
</div>
<div style="height: 50px"></div>
<#--	<!--右侧内容&ndash;&gt;-->
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/tabs.js"></script>
<script type="text/javascript" src="${re.contextPath}/pageoffice.js" id="po_js_main"></script>
<#--<script type="text/html" id="xmjb">-->
<#--	{{# if(d.flag){ }}-->
<#--	<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="update"><i class="layui-icon">&#xe640;</i>编辑</a>-->
<#--	{{# }else{ }}-->
<#--	<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="handle"><i class="layui-icon">&#xe640;</i>办理</a>-->
<#--	{{# } }}-->
<#--</script>-->
<script type="text/html" id="fmc">
    <div>
        <p>{{d.obj1[0].data1}}</p>
        <p class="cursor" style="color: dodgerblue" onclick='seeAllMembers(&apos;{{d.spfF1}}&apos;,&apos;{{JSON.stringify(d.obj1)}}&apos;)'>查看全部发明人</p>
    </div>
</script>
<script type="text/html" id="nfje">
    <div>
        <p>{{d.obj2[0].data2}}</p>
    </div>
</script>
<script type="text/html" id="nfjfsj">
    <div>
        <p>{{d.obj2[0].data3}}</p>
    </div>
</script>
<script type="text/html" id="nfndkd">
    <div>
        <p>{{d.obj2[0].data4}}</p>
    </div>
</script>
<script type="text/html" id="nfjbr">
    <div>
        <p>{{d.obj2[0].data5}}</p>
    </div>
</script>
<script type="text/html" id="nfqbnf">
    <div>
        <p class="cursor" style="color: dodgerblue" onclick='seeAllNfs(&apos;{{d.spfF1}}&apos;,&apos;{{JSON.stringify(d.obj2)}}&apos;)'>全部年费</p>
    </div>
</script>
<script type="text/javascript">
    var table,tableIns,laydate,form,layer;
    layui.use(['laydate','table','form','layer'], function () {
        laydate = layui.laydate;
        table = layui.table;
        form = layui.form;
        layer = layui.layer;

        initTable();

    });

    function initTable(){
        var jsonDataStr = localStorage.getItem("count-detail-filter-zl");
        var jsonData = JSON.parse(jsonDataStr);
        //方法级渲染
        tableIns = table.render({
            id: 'booktable',
            elem: '#booktable',
            url: '/search/decision/form/book/110002',
            height: "full",
            where: jsonData,
            page: true,
            cols: [[
                {
                    title: '序号', width: '8%', rowspan: 2, templet: function (res) {
                        return res.LAY_INDEX;
                    }
                },
                {field: 'spfF1', title: '专利名称', width: '18%', rowspan: 2},
                {field: 'spfF2', title: '专利类型', width: '10%', rowspan: 2,templet: function (d) {
                        return '<span>'+getZllx(d.spfF2)+'</span>';
                    }
                },
                {field: 'spfF3', title: '阶段', width: '10%', rowspan: 2,templet: function (d) {
                        return '<span>'+getJd(d.spfF3)+'</span>';
                    }
                },
                {field: 'spfF4', title: '撰写人', width: '10%', rowspan: 2},
                {field: 'spfF5', title: '申请人', width: '10%', rowspan: 2},
                {align: 'center', title: '发明人',colspan: 1,colGroup: true},
                {align: 'center', title: '技术交底书', colspan: 3},
                {align: 'center', title: '权利要求书', colspan: 5},
                {align: 'center', title: '国知局受理通知书', colspan: 3},
                {align: 'center', title: '官费', colspan: 4},
                {align: 'center', title: '专利授权书', colspan: 3},
                {align: 'center', title: '第一次-年费', colspan: 5},
                {field: 'spfF18', title: '备注', width: '15%', rowspan: 2}
            ],
                [{field: 'obj1', title: '第一发明人', width: '10%', templet: '#fmc'},
                    {field: 'spfF6', title: '技术交底书名称', width: '10%'},
                    {field: 'spfF7', title: '技术交底书提交时间', width: '10%'},
                    {field: 'fileList1', title: '技术交底书', width: '10%',templet: function(d){
                            var returnStr = '';
                            if(d.fileList1 && d.fileList1.length > 0){
                                for(var a=0;a<d.fileList1.length;a++){
                                    returnStr = returnStr + '<p>'+d.fileList1[a].fileName+'</p>';
                                }
                                return returnStr;
                            }else{
                                return '';
                            }
                        }},
                    {field: 'spfF8', title: '权利要求书名称', width: '10%'},
                    {field: 'spfF9', title: '权利要求书提交时间', width: '10%'},
                    {field: 'spfF7', title: '权利要求书', width: '10%',templet: function(d){
                            var returnStr = '';
                            if(d.fileList2 && d.fileList2.length > 0){
                                for(var a=0;a<d.fileList2.length;a++){
                                    returnStr = returnStr + '<p>'+d.fileList2[a].fileName+'</p>';
                                }
                                return returnStr;
                            }else{
                                return '';
                            }
                        }},
                    {field: 'spfF7', title: '专利检索报告', width: '10%',templet: function(d){
                            var returnStr = '';
                            if(d.fileList3 && d.fileList3.length > 0){
                                for(var a=0;a<d.fileList3.length;a++){
                                    returnStr = returnStr + '<p>'+d.fileList3[a].fileName+'</p>';
                                }
                                return returnStr;
                            }else{
                                return '';
                            }
                        }},
                    {field: 'spfF7', title: '递交信息确认表', width: '10%',templet: function(d){
                            var returnStr = '';
                            if(d.fileList4 && d.fileList4.length > 0){
                                for(var a=0;a<d.fileList4.length;a++){
                                    returnStr = returnStr + '<p>'+d.fileList4[a].fileName+'</p>';
                                }
                                return returnStr;
                            }else{
                                return '';
                            }
                        }},
                    {field: 'spfF10', title: '国知局受理时间', width: '10%'},
                    {field: 'spfF11', title: '国知局受理通知书编号', width: '10%'},
                    {field: 'spfF11', title: '受理书', width: '10%',templet: function(d){
                            var returnStr = '';
                            if(d.fileList5 && d.fileList5.length > 0){
                                for(var a=0;a<d.fileList5.length;a++){
                                    returnStr = returnStr + '<p>'+d.fileList5[a].fileName+'</p>';
                                }
                                return returnStr;
                            }else{
                                return '';
                            }
                        }},
                    {field: 'spfF12', title: '实审官费(金额)', width: '10%'},
                    {field: 'spfF13', title: '实审官费缴纳时间', width: '10%'},
                    {field: 'spfF14', title: '授权登记费金额', width: '10%'},
                    {field: 'spfF15', title: '授权登记费缴费时间', width: '10%'},
                    {field: 'spfF16', title: '专利授权书编号', width: '10%'},
                    {field: 'spfF17', title: '专利授权书授权时间', width: '10%'},
                    {field: 'spfF15', title: '专利授权书', width: '10%',templet: function(d){
                            var returnStr = '';
                            if(d.fileList6 && d.fileList6.length > 0){
                                for(var a=0;a<d.fileList6.length;a++){
                                    returnStr = returnStr + '<p>'+d.fileList6[a].fileName+'</p>';
                                }
                                return returnStr;
                            }else{
                                return '';
                            }
                        }},
                    {field: 'obj2', title: '金额', width: '10%',templet: '#nfje',templet: function(d){
                            if(d.obj2){
                                return '<p>'+d.obj2[0].data2+'</p>';
                            }else{
                                return '';
                            }
                        }},
                    {field: 'formDataList', title: '缴费时间', width: '10%',templet: '#nfjfsj',templet: function(d){
                            if(d.obj2){
                                return '<p>'+d.obj2[0].data3+'</p>';
                            }else{
                                return '';
                            }
                        }},
                    {field: 'formDataList', title: '年费跨度', width: '10%',templet: '#nfndkd',templet: function(d){
                            if(d.obj2){
                                return '<p>'+d.obj2[0].data4+'</p>';
                            }else{
                                return '';
                            }
                        }},
                    {field: 'formDataList', title: '经办人', width: '10%',templet: '#nfjbr',templet: function(d){
                            if(d.obj2){
                                return '<p>'+d.obj2[0].data5+'</p>';
                            }else{
                                return '';
                            }
                        }},
                    {field: 'formDataList', title: '全部年费', width: '10%',templet: '#nfqbnf'}
                ]
            ],
            done: function (res, currentCount) {

            }
        });
    }

    function getQuaryData(){
        //专利名称
        var zlmcSelect = $('#zl_name').val();

        //专利类型:
        var zllxSelect = $('#zl_type_select').val();
        if(zllxSelect == '000'){
            zllxSelect = '';
        }

        //阶段
        var jdSelect = $('#jd_select').val();
        if(jdSelect == '000'){
            jdSelect = '';
        }

        //第一发明人:
        var dyfmrSelect = $('#dyfmr').val();

        //国知局受理时间开始日期
        var sl_startSelect= $('#sl_date_start').val();

        //国知局受理时间结束日期
        var sl_endSelect= $('#sl_date_end').val();

        //专业授权书授权时间
        var sq_startSelect = $('#sq_date_start').val();

        //专业授权书授权结束时间
        var sq_endSelect = $('#sq_date_end').val();

        var jsondata = {
            spfF1:zlmcSelect,
            spfF2:zllxSelect,
            spfF3:jdSelect,
            obj5:dyfmrSelect,
            obj1: sl_startSelect,
            obj2: sl_endSelect,
            obj3: sq_startSelect,
            obj4: sq_endSelect
        };
        return jsondata;
    }



    function query() {
        initTable();
    }

    function resetQuery(){
        $('#lw_name').val('');
        $('#qk_type_select').val('000');
        $('#qk_name').val('');
        $('#jk_date_start').val('');
        $('#jk_date_end').val('000');
        query();
    }

    function getZllx(zllx){
        var zllxListStr = '${zllxListStr}';
        var zllxList = JSON.parse(zllxListStr);
        var returnStr = '';
        if(zllxList && zllxList.length>0){
            for(var a=0;a<zllxList.length;a++){
                if(zllx == zllxList[a].badtCode){
                    returnStr = zllxList[a].badtName;
                }
            }
        }
        return returnStr;
    }

    function getJd(jd){
        var jdListStr = '${jdListStr}';
        var jdList = JSON.parse(jdListStr);
        var returnStr = '';
        if(jdList && jdList.length>0){
            for(var a=0;a<jdList.length;a++){
                if(jd == jdList[a].badtCode){
                    returnStr = jdList[a].badtName;
                }
            }
        }
        return returnStr;
    }

    function viewTable(){
        var jsondata = getQuaryData();
        layerAjaxGet('/search/decision/form/book/viewTable/110002',jsondata,'',function (res) {
            if(res.flag){
                if(res.data){
                    var w = ($(window).width()*0.8);
                    var h = ($(window).height()*0.8);
                    POBrowser.openWindowModeless('/sys/office/openwordTemp?ft=1&fid=' + res.data, 'width=1200px;height=800px;', '{}')
                }
            }
        })

    }

    function exportTable(){
        var jsondata = {


            obj5:dyfmrSelect,
            obj1: sl_startSelect,
            obj2: sl_endSelect,
            obj3: sq_startSelect,
            obj4: sq_endSelect
        };
        var para = '';
        //专利名称
        var zlmcSelect = $('#zl_name').val();
        if(zlmcSelect){
            para = para+'&spfF1='+zlmcSelect;
        }
        //专利类型:
        var zllxSelect = $('#zl_type_select').val();
        if(zllxSelect == '000'){
            zllxSelect = '';
        }
        if(zllxSelect){
            para = para+'&spfF2='+zllxSelect;
        }
        //阶段
        var jdSelect = $('#jd_select').val();
        if(jdSelect == '000'){
            jdSelect = '';
        }
        if(jdSelect){
            para = para+'&spfF3='+jdSelect;
        }
        //第一发明人:
        var dyfmrSelect = $('#dyfmr').val();
        if(dyfmrSelect){
            para = para+'&obj5='+dyfmrSelect;
        }
        //国知局受理时间开始日期
        var sl_startSelect= $('#sl_date_start').val();
        if(sl_startSelect){
            para = para+'&obj1='+sl_startSelect;
        }
        //国知局受理时间结束日期
        var sl_endSelect= $('#sl_date_end').val();
        if(sl_endSelect){
            para = para+'&obj2='+sl_endSelect;
        }
        //专业授权书授权时间
        var sq_startSelect = $('#sq_date_start').val();
        if(sq_startSelect){
            para = para+'&obj3='+sq_startSelect;
        }
        //专业授权书授权结束时间
        var sq_endSelect = $('#sq_date_end').val();
        if(sq_endSelect){
            para = para+'&obj4='+sq_endSelect;
        }
        //获取全部数据:
        var url= '/search/decision/form/export/book/110002?a_='+Math.random()+para;
        location.href = url;
    }

    function seeAllMembers(zlmc,fmrListStr){
        var names = [];
        var fmrList = JSON.parse(fmrListStr);
        if(fmrList){
            for(var a=0;a<fmrList.length;a++){
                if(fmrList[a].data1){
                    var aStData = {};
                    aStData.index = a+1;
                    aStData.name = fmrList[a].data1;
                    names[names.length] = aStData;
                }
            }
            // for(var b=0;b<20;b++){
            // 	var testData = {};
            // 	testData.index = names.length+1;
            // 	testData.name = '测试';
            // 	names[names.length] = testData;
            // }
            localStorage.setItem("form-project-name",zlmc);
            localStorage.setItem("form-project-members",JSON.stringify(names));
            localStorage.setItem("form-project-field-name",'发明人');
            var w = ($(window).width()*0.8);
            var h = ($(window).height()*0.8);
            layer.open({
                type: 2,
                title: false,
                closeBtn: 1,
                shade: 0.8,
                area: [w+'px',h+'px'],
                content: '/search/decision/showMembers',
                success: function(layero, index){

                },
                end: function () {
                    localStorage.removeItem("form-project-name");
                    localStorage.removeItem("form-project-members");
                    localStorage.removeItem("form-project-field-name");
                }
            })
        }
    }


    function seeAllNfs(zlmc,obj2){
        var cols = [];
        var innerCol = [];

        var field1 = {title: '序号', width: '15%', templet: '#index'};
        innerCol[innerCol.length] = field1;
        var field2 =  {field: 'data2',title: '金额（元）', width: '15%'};
        innerCol[innerCol.length] = field2;
        var field3 =  {field: 'data3',title: '缴费时间', width: '30%'};
        innerCol[innerCol.length] = field3;
        var field4 =  {field: 'data4',title: '年费跨度', width: '20%'};
        innerCol[innerCol.length] = field4;
        var field5 =  {field: 'data5',title: '经办人', width: '20%'};
        innerCol[innerCol.length] = field5;
        cols[cols.length] = innerCol;
        localStorage.setItem('form-smart-table-type','colsAndDatas');
        localStorage.setItem("form-project-name",zlmc);
        localStorage.setItem("colsAndDatas-cols",JSON.stringify(cols));
        localStorage.setItem("colsAndDatas-datas",obj2);
        var w = ($(window).width()*0.8);
        var h = ($(window).height()*0.8);
        layer.open({
            type: 2,
            title: false,
            closeBtn: 1,
            shade: 0.8,
            area: [w+'px',h+'px'],
            content: '/search/decision/showMembers',
            success: function(layero, index){

            },
            end: function () {
                localStorage.removeItem("form-project-name");
                localStorage.removeItem("form-project-members");
                localStorage.removeItem("form-project-field-name");
            }
        })
    }



</script>
</body>

</html>